#include <stdio.h>
#include <sys/socket.h>
#include <netdb.h>

#include <netinet/in.h>
#include <netinet/ip.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

#include <arpa/inet.h>
#include <strings.h>

#include "http.h"

int main()
{
    char *url = "http://apis.juhe.cn//simpleWeather/query?city=%E5%B9%BF%E5%B7%9E&key=ad1fcfc94b50ff2b7fac1c4e1d4568c7";
    http_init(url);

    http_setRawHeader("Host", "apis.juhe.cn");
    http_setRawHeader("Content-Type", "application/x-www-form-urlencoded");
    http_get();

    char *replyData;
    http_reply(&replyData);
    printf("replyData:%s\n", replyData);
    http_destory();

    return 0;
}

// 返回JSON数据格式    cjson